From fcc8d778b544379e2ceabd3dcade7c502172f64b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sun, 31 Dec 2017 08:45:40 +0100 Subject: [PATCH] gl renderer: Avoid some code duplication --- gsk/gl/gskglrenderer.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 8b4f7439a2..7a69d59d42 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -957,42 +957,30 @@ render_outset_shadow_node (GskGLRenderer *self, if (blur_radius > 0) { ops_set_program (builder, &self->blur_program); - ops_set_clip (builder, &blit_clip); - ops_set_texture (builder, texture_id); op.op = OP_CHANGE_BLUR; - op.blur.dir[0] = 1; - op.blur.dir[1] = 0; op.blur.size.width = texture_width; op.blur.size.height = texture_height; op.blur.radius = blur_radius; ops_add (builder, &op); - - ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) { - { { 0, 0 }, { 0, 1 }, }, - { { 0, texture_height }, { 0, 0 }, }, - { { texture_width, 0 }, { 1, 1 }, }, - - { { texture_width, texture_height }, { 1, 0 }, }, - { { 0, texture_height }, { 0, 0 }, }, - { { texture_width, 0 }, { 1, 1 }, }, - }); } else { ops_set_program (builder, &self->blit_program); - ops_set_clip (builder, &blit_clip); - ops_set_texture (builder, texture_id); - ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) { - { { 0, 0 }, { 0, 1 }, }, - { { 0, texture_height }, { 0, 0 }, }, - { { texture_width, 0 }, { 1, 1 }, }, - - { { texture_width, texture_height }, { 1, 0 }, }, - { { 0, texture_height }, { 0, 0 }, }, - { { texture_width, 0 }, { 1, 1 }, }, - }); } + ops_set_clip (builder, &blit_clip); + ops_set_texture (builder, texture_id); + ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) { + { { 0, 0 }, { 0, 1 }, }, + { { 0, texture_height }, { 0, 0 }, }, + { { texture_width, 0 }, { 1, 1 }, }, + + { { texture_width, texture_height }, { 1, 0 }, }, + { { 0, texture_height }, { 0, 0 }, }, + { { texture_width, 0 }, { 1, 1 }, }, + }); + + ops_set_clip (builder, &prev_clip); ops_set_viewport (builder, &prev_viewport); -- 2.30.2